import java.util.Arrays;
import java.util.Collection;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner s=new Scanner(System.in);
        int[] a=new int[10];
        for (int i = 0; i < 10; i++) {
            a[i]=s.nextInt();
        }
        int left=0;
        int right=9;
        int[] b=new int[10];
        for (int i = 0; i < 10; i++) {
            if(a[i]%2!=0){
                b[left]=a[i];
                left++;
            }
            else {
                b[right] = a[i];
                right--;
            }
        }
        Arrays.sort(b,right+1,10);
        for (int i = 0; i < left-1; i++) {
            for (int j= 0; j < left - 1-i; j++) {
                if(b[j]<b[j+1]){
                    int tmp=b[j];
                    b[j]=b[j+1];
                    b[j+1]=tmp;
                }
            }
        }
        for (int i = 0; i < 10; i++) {
            System.out.printf(b[i]+" ");
        }










    }
}